 {

        var o = require("../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {
                spDown_light: {
                    default: null,
                    type: cc.Sprite
                },
                spRight_light: {
                    default: null,
                    type: cc.Sprite
                },
                spUp_light: {
                    default: null,
                    type: cc.Sprite
                },
                spLeft_light: {
                    default: null,
                    type: cc.Sprite
                },
                spDown: {
                    default: null,
                    type: cc.Sprite
                },
                spRight: {
                    default: null,
                    type: cc.Sprite
                },
                spUp: {
                    default: null,
                    type: cc.Sprite
                },
                spLeft: {
                    default: null,
                    type: cc.Sprite
                },
                labTimer: {
                    default: null,
                    type: cc.Label
                },
                spPlayModel: {
                    default: null,
                    type: cc.Sprite
                },
                labBaseChip: {
                    default: null,
                    type: cc.Label
                },
                _curTime: 0,
                _curSeatId: 0,
                _windowTimer: null
            },
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.GAME_UPDATA_TIME_OUT, this._updateTime.bind(this), this),
                    Global.notificationCenter.on(Global.eventName.GAME_REFRESH_STAND_TILE, this._refresh.bind(this), this);
                var e = Global.tableModel.getTableType(), t = Global.tableModel.getPlayMode(),
                    n = Global.tableModel.getParmsOptionInfo();
                n && n.length > 0 && (t == Global.config.playModel.XUEZHAN ? n[0].indexOf("换三张") > 0 ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz5") : n[0].indexOf("换四张") > 0 ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz6") : this.spPlayModel.node.active = !1 : t == Global.config.playModel.XUELIU ? n[0].indexOf("换三张") > 0 ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz1") : n[0].indexOf("换四张") > 0 ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz4") : this.spPlayModel.node.active = !1 : t == Global.config.playModel.ERREN ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz7") : t == Global.config.playModel.ERRENQUICK && Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "shuiying"));
                var o = Global.utils.getNumInString(n[1]);
                this.labBaseChip.string = "底分：" + o, e == Global.config.tableType.CREATE && (t == Global.config.playModel.XUELIU ? Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz1") : Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz5"),
                    this.labBaseChip.string = "底分：" + Global.tableModel.getBaseChip()), e == Global.config.tableType.SCORE_TABLE && (t == Global.config.playModel.XUELIU && Global.spriteAtlas.setSpriteFrame(this.spPlayModel, "Texture/table", "zz4"),
                    this.labBaseChip.string = "底分：" + Global.tableModel.getBaseChip());
                var i = {
                    timeOut: -1,
                    curSeatId: Global.tableModel.getHeadSeat()
                };
                this._updateTime(i);
            },
            onDestroy: function () {
                Global.notificationCenter.offAll(this), this._windowTimer && window.clearInterval(this._windowTimer);
            },
            _refresh: function () {
                Global.notificationCenter.emit(Global.eventName.GAME_SHOW_TIMER, !0), Global.notificationCenter.emit(Global.eventName.GAME_DESTROY_CRAPSHOOT);
            },
            start: function () {
            },
            _updateTime: function (e) {
                this._curTime = e.timeOut, this._curSeatId = e.curSeatId, this._reSet(), this._windowTimer && window.clearInterval(this._windowTimer),
                    this._windowTimer = window.setInterval(this._timeCallback.bind(this), 1e3), this._timeCallback();
            },
            _reSet: function () {
                for (var e = Global.tableModel.getHeadSeat(), t = Global.tableModel.toLocalSeatIndex(e), n = Global.tableModel.toLocalSeatIndex(this._curSeatId), o = -1, i = Global.tableModel.getPlayerModels(), a = null != i ? i.length : 0, r = 0; r < a; r++) {
                    var s = Global.tableModel.getPlayerModel(r);
                    if (s && 0 == s.getSeatId()) {
                        o = Global.tableModel.toLocalSeatIndex(s.getSeatId());
                        break;
                    }
                }
                -1 == o && (console.error("nodeTimer _reSet seatIdLocalEast = ", o), o = t);
                var l = [], c = Global.tableModel.getMaxSeat();
                Global.roomInfoModel.getPlayModel() != Global.config.playModel.ERREN && Global.roomInfoModel.getPlayModel() != Global.config.playModel.ERRENQUICK || (c = 4);
                for (var d = 0; d < c; d++) l.push((o + d) % 4);
                var u = [["tableinfo_east_selected_orange", "tableinfo_east_selected_blue", "tableinfo_east_selected_green", "tableinfo_east_selected_red", "tableinfo_east_unselected"], ["tableinfo_south_selected_orange", "tableinfo_south_selected_blue", "tableinfo_south_selected_green", "tableinfo_south_selected_red", "tableinfo_south_unselected"], ["tableinfo_west_selected_orange", "tableinfo_west_selected_blue", "tableinfo_west_selected_green", "tableinfo_west_selected_red", "tableinfo_west_unselected"], ["tableinfo_north_selected_orange", "tableinfo_north_selected_blue", "tableinfo_north_selected_green", "tableinfo_north_selected_red", "tableinfo_north_unselected"]];
                for (d = 0; d < l.length; d++) {
                    var h = l[d], f = h;
                    h != n && (f = 4);
                    var p = u[d][f], g = null, b = null;
                    if (h == Global.config.SEAT_DOWN && (g = this.spDown, b = this.spDown_light), h == Global.config.SEAT_RIGHT && (g = this.spRight,
                        b = this.spRight_light), h == Global.config.SEAT_UP && (g = this.spUp, b = this.spUp_light),
                    h == Global.config.SEAT_LEFT && (g = this.spLeft, b = this.spLeft_light), g && Global.spriteAtlas.setSpriteFrame(g, "Texture/table", p),
                    g && (g.node.stopAllActions(), g.node.opacity = 255, g.node.color = cc.color(255, 255, 255, 255)),
                    b && (b.node.active = !0, b.node.stopAllActions(), b.node.opacity = 0), n == h) {
                        if (g) {
                            var m = cc.repeatForever(cc.sequence(cc.tintTo(1, 80, 80, 80), cc.tintTo(1, 255, 255, 255)));
                            g.node.runAction(m);
                        }
                        if (b) {
                            b.node.opacity = 255;
                            m = cc.repeatForever(cc.sequence(cc.fadeOut(1), cc.fadeIn(1)));
                            b.node.runAction(m);
                        }
                    }
                    if (this._curTime < 0) {
                        if (g) {
                            g.node.stopAllActions(), g.node.opacity = 100, g.node.color = cc.color(255, 255, 255, 255);
                            p = u[d][4];
                            Global.spriteAtlas.setSpriteFrame(g, "Texture/table", p);
                        }
                        b && (b.node.active = !0, b.node.stopAllActions(), b.node.opacity = 0);
                    }
                }
            },
            _timeCallback: function () {
                Global.tableModel.getIsGameEnd() ? this._resetData() : (this._curTime < 0 && (this._curTime = 0),
                3 == this._curTime && o.playAlarm(), this.labTimer.string = this._curTime + "",
                    this._curTime--);
            },
            _resetData: function () {
                this._windowTimer && window.clearInterval(this._windowTimer), this._curTime = 0,
                    this.labTimer.string = this._curTime + "";
            }
        })
    }